package com.devgear.codesizer.model;

// Generated 24-oct-2011 0:54:57 by Hibernate Tools 3.4.0.CR1

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * ExtraTask generated by hbm2java
 */
@Entity
@Table(name = "extra_tasks", schema = "public")
public class ExtraTask implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private int idExtraTask;
	private Activity activity;
	private Client client;
	private String name;
	private int estimatedUnits;
	private Set<ProjectType> projectTypes = new HashSet<ProjectType>(0);
	private Set<ProjectExtraTasks> projectExtraTaskses = new HashSet<ProjectExtraTasks>(
			0);

	public ExtraTask() {
	}

	public ExtraTask(int idExtraTask, Activity activity, Client client,
			String name, int estimatedUnits) {
		this.idExtraTask = idExtraTask;
		this.activity = activity;
		this.client = client;
		this.name = name;
		this.estimatedUnits = estimatedUnits;
	}

	public ExtraTask(int idExtraTask, Activity activity, Client client,
			String name, int estimatedUnits, Set<ProjectType> projectTypes,
			Set<ProjectExtraTasks> projectExtraTaskses) {
		this.idExtraTask = idExtraTask;
		this.activity = activity;
		this.client = client;
		this.name = name;
		this.estimatedUnits = estimatedUnits;
		this.projectTypes = projectTypes;
		this.projectExtraTaskses = projectExtraTaskses;
	}

	@Id
	@Column(name = "id_extra_task", unique = true, nullable = false)
	public int getIdExtraTask() {
		return this.idExtraTask;
	}

	public void setIdExtraTask(int idExtraTask) {
		this.idExtraTask = idExtraTask;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "id_activity", nullable = false)
	public Activity getActivity() {
		return this.activity;
	}

	public void setActivity(Activity activity) {
		this.activity = activity;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "id_client", nullable = false)
	public Client getClient() {
		return this.client;
	}

	public void setClient(Client client) {
		this.client = client;
	}

	@Column(name = "name", nullable = false, length = 50)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "estimated_units", nullable = false)
	public int getEstimatedUnits() {
		return this.estimatedUnits;
	}

	public void setEstimatedUnits(int estimatedUnits) {
		this.estimatedUnits = estimatedUnits;
	}

	@ManyToMany(fetch = FetchType.LAZY, mappedBy = "extraTasks")
	public Set<ProjectType> getProjectTypes() {
		return this.projectTypes;
	}

	public void setProjectTypes(Set<ProjectType> projectTypes) {
		this.projectTypes = projectTypes;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "extraTask")
	public Set<ProjectExtraTasks> getProjectExtraTaskses() {
		return this.projectExtraTaskses;
	}

	public void setProjectExtraTaskses(
			Set<ProjectExtraTasks> projectExtraTaskses) {
		this.projectExtraTaskses = projectExtraTaskses;
	}

}
